package cn.shengchao.examstar.knowledge.acl.dto;

import cn.shengchao.examstar.knowledge.domain.enums.MasteryLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 知识点掌握度数据传输对象
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class KnowledgePointMasteryDTO {
    
    /**
     * ID
     */
    private Long id;
    
    /**
     * 用户ID
     */
    private Long userId;
    
    /**
     * 知识点ID
     */
    private Long knowledgePointId;
    
    /**
     * 掌握程度S-精通, A-掌握, B-理解, C-初步了解, N-未检测
     */
    private String degreeOfMastery;
    
    /**
     * 正确率
     */
    private String accuracyRate;
    
    /**
     * 学习计划ID
     */
    private Long studyPlanId;
    
    /**
     * 状态：1-新建，2-练习中，3-总结
     */
    private Integer status;
    
    /**
     * 获取掌握程度枚举值
     */
    public MasteryLevel getMasteryLevel() {
        return MasteryLevel.fromCode(degreeOfMastery);
    }
    
    /**
     * 获取掌握程度描述
     */
    public String getMasteryDescription() {
        return MasteryLevel.getDescriptionByCode(degreeOfMastery);
    }
} 